<include file="public/layout" />
<style>
.ncm-goods-gift {
	text-align: left;
}
.ncm-goods-gift ul {
    display: inline-block;
    font-size: 0;
    vertical-align: middle;
}
.ncm-goods-gift li {
    display: inline-block;
    letter-spacing: normal;
    margin-right: 4px;
    vertical-align: top;
    word-spacing: normal;
}
.ncm-goods-gift li a {
    background-color: #fff;
    display: table-cell;
    height: 30px;
    line-height: 0;
    overflow: hidden;
    text-align: center;
    vertical-align: middle;
    width: 30px;
}
.ncm-goods-gift li a img {
    max-height: 30px;
    max-width: 30px;
}

a.green{
	
	background: #fff none repeat scroll 0 0;
    border: 1px solid #f5f5f5;
    border-radius: 4px;
    color: #999;
    cursor: pointer !important;
    display: inline-block;
    font-size: 12px;
    font-weight: normal;
    height: 20px;
    letter-spacing: normal;
    line-height: 20px;
    margin: 0 5px 0 0;
    padding: 1px 6px;
    vertical-align: top;
}

a.green:hover { color: #FFF; background-color: #1BBC9D; border-color: #16A086; }

.ncap-order-style .ncap-order-details{
	margin:20px auto;
}
.contact-info h3,.contact-info .form_class{
  display: inline-block;
  vertical-align: middle;
}
.form_class i.fa{
  vertical-align: text-bottom;
}
</style>
<div class="page">
  <div class="fixed-bar">
    <div class="item-title"><a class="back" href="javascript:history.go(-1)" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
      <div class="subject">
        <h3>商品订单</h3>
        <h5>商城实物商品交易订单查询及管理</h5>
      </div>
      <div class="subject" style="width:62%">
	     <if condition="$order['order_status'] lt 2">
      		<a href="{:U('Admin/order/edit_order',array('order_id'=>$order['order_id']))}" style="float:right;margin-right:10px" class="ncap-btn-big ncap-btn-green" ><i class="fa fa-pencil-square-o"></i>修改订单</a>
      	 </if>
      	 <if condition="($split eq 1) and ($order['order_status'] lt 2)">
      		<a href="{:U('Admin/order/split_order',array('order_id'=>$order['order_id']))}" style="float:right;margin-right:10px" class="ncap-btn-big ncap-btn-green" ><i class="fa fa-external-link-square"></i>拆分订单</a>
      	 </if>
      	 <a href="{:U('Order/order_print',array('order_id'=>$order['order_id']))}" target="_blank" data-toggle="tooltip" title="" class="btn btn-primary" data-original-title="打印订单">
      	 <a href="{:U('Order/order_print',array('order_id'=>$order['order_id']))}" style="float:right;margin-right:10px" class="ncap-btn-big ncap-btn-green" ><i class="fa fa-print"></i>打印订单</a>
      	 </a>	
      </div>
    </div>
      
  </div>
  <div class="ncap-order-style">
    <div class="titile">
      <h3></h3>
    </div>
 
    <div class="ncap-order-details">
      <form id="order-action">
        <div class="tabs-panels">
            <div class="misc-info">
                <h3>基本信息</h3>
                <dl>
                    <dt>订单 ID：</dt>
                    <dd>{$order.order_id}</dd>
                    <dt>订单号：</dt>
                    <dd>{$order.order_sn}</dd>
                    <dt>会员：</dt>
                    <dd>{$user.nickname}  ID:{$user.user_id}</dd>
                </dl>
                <dl>
                    <dt>E-Mail：</dt>
                    <dd>{$order.email}</dd>
                    <dt>电话：</dt>
                    <dd>{$order.mobile}</dd>
                    <dt>应付金额：</dt>
                    <dd>{$order.order_amount}</dd>
                </dl>
                <dl>
                    <dt>订单状态：</dt>
                    <dd>{$order_status[$order[order_status]]} / {$pay_status[$order[pay_status]]}
                        <if condition="$order['pay_code'] eq 'cod'"><span style="color: red">(货到付款)</span></if>
                        / {$shipping_status[$order[shipping_status]]}
                    </dd>
                    <dt>下单时间：</dt>
                    <dd>{$order.add_time|date='Y-m-d H:i',###}</dd>
                    <dt>支付时间：</dt>
                    <dd>
                        <if condition="$order.pay_time neq 0">{$order.pay_time|date='Y-m-d H:i',###}
                            <else/>
                            N
                        </if>
                    </dd>
                </dl>
                <dl>
                    <dt>支付方式：</dt>
                    <dd>{$order.pay_name|default='其他方式'}</dd>
                    <dt>发票抬头：</dt>
                    <dd>{$order.invoice_title|default='N'}</dd>
                </dl>
            </div>
        <div class="addr-note">
          <h4>收货信息</h4>
          <dl>
            <dt>收货人：</dt>
            <dd>{$order.consignee}</dd>
            <dt>联系方式：</dt>
            <dd>{$order.mobile}</dd>
          </dl>
          <dl>
            <dt>收货地址：</dt>
            <dd>{$order.address2}</dd>
          </dl>
          <dl>
            <dt>邮编：</dt>
            	<dd><if condition="$order.zipcode neq ''"> {$order.zipcode}<else/>N</if></dd>
          </dl>
          <dl>
           		<dt>配送方式：</dt>
            	<dd>{$order.shipping_name}</dd>
          	</dl>
          	<dl>
           		<dt>留言：</dt>
            	<dd>{$order.user_note|default=''}</dd>
          	</dl>
        </div>
  
         
        <div class="goods-info">
          <h4>商品信息</h4>
          <table>
            <thead>
              <tr>
                <th >商品编号</th>
                <th colspan="2">商品</th>
                <th>规格属性</th>
                <th>数量</th>
                <th>单品价格</th>
                <th>会员折扣价</th>
                <th>单品小计</th>
              </tr>
            </thead>
            <tbody>
            <volist name="orderGoods" id="good">
           	<tr>
                <td class="w60">{$good.goods_sn}</td>
                <td class="w30"><div class="goods-thumb"><a href="{:U('Home/Goods/goodsInfo',array('id'=>$good['goods_id']))}" target="_blank"><img alt="" src="{$good['goods_id']|goods_thum_images=200,200}" /> </a></div></td>
                <td style="text-align: left;"><a href="{:U('Home/Goods/goodsInfo',array('id'=>$good['goods_id']))}" target="_blank">{$good.goods_name}</a><br/></td>
                <td class="w80">{$good.spec_key_name}</td>
                <td class="w60">{$good.goods_num}</td>
                <td class="w100">{$good.goods_price}</td>
                <td class="w60">{$good.member_goods_price}</td>
                <td class="w80">{$good.goods_total}</td>
              </tr>
              </volist>
          </table>
        </div>
        <div class="total-amount contact-info">
          <h3>订单总额：￥{$order.goods_price}</h3>
        </div>
        <div class="contact-info">
          <h3>费用信息 </h3>
          <div class="form_class">
          		<a class="btn green" href="{:U('Admin/Order/editprice',array('order_id'=>$order['order_id']))}"><i class="fa fa-pencil-square-o"></i>修改费用</a>
          </div>   
          <dl>
            <dt>小计：</dt>
            <dd>{$order.goods_price}</dd>
            <dt>运费：</dt>
            <dd>+{$order.shipping_price}</dd>
            <dt>积分 (-{$order.integral})：</dt>
            <dd>-{$order.integral_money}</dd>
          </dl>
          <dl>
            <dt>余额抵扣：</dt>
            <dd>-{$order.user_money}</dd>
            <dt>优惠券抵扣：</dt>
            <dd>-{$order.coupon_price}</dd>
            <dt>价格调整：</dt>
            <dd>减：{$order.discount}</dd>
          </dl>
          <dl>
            <dt>应付：</dt>
            <dd><strong class="red_common">{$order.order_amount}</strong></dd>
           </dl>
        </div>
        <div class="contact-info">
          <h3>操作信息</h3>
          <dl class="row">
	        <dt class="tit">
	          <label for="note">操作备注</label>
	        </dt>
	        <dd class="opt" style="margin-left:10px">
	         <textarea id="note" name="note" style="width:600px" rows="6"  placeholder="请输入操作备注" class="tarea">{$keyword.text}</textarea>
	        </dd>
	      </dl> 
	      <dl class="row">
	        <dt class="tit">
	          <label for="note">可执行操作</label>
	        </dt>
	        <dd class="opt" style="margin-left:10px">
	         	<foreach name="button" item="vo" key="k">
               		<if condition="$k eq 'pay_cancel'">
               			<a class="ncap-btn-big ncap-btn-green" href="javascript:void(0)" data-url="{:U('Order/pay_cancel',array('order_id'=>$order['order_id']))}" onclick="pay_cancel(this)">{$vo}</a>
               		<elseif condition="$k eq 'delivery'"/>                                                 
               			<a class="ncap-btn-big ncap-btn-green" href="{:U('Order/delivery_info',array('order_id'=>$order['order_id']))}">{$vo}</a>
               		<elseif condition="$k eq 'refund'"/>
               		<else/>
               		<a class="ncap-btn-big ncap-btn-green" onclick="ajax_submit_form('order-action','{:U('Admin/order/order_action',array('order_id'=>$order['order_id'],'type'=>$k))}');" >
               		{$vo}</a>
               		</if>
               	</foreach>
	        </dd>
	      </dl> 
        </div>
        <div class="goods-info">
          <h4>操作记录</h4>
          <table>
            <thead>
              <tr>
                <th>操作者</th>
                <th>操作时间</th>
                <th>订单状态</th>
                <th>付款状态</th>
                <th>发货状态</th>
                <th>描述</th>
                <th>备注</th>
              </tr>
            </thead>
            <tbody>
            <volist name="action_log" key="aid" id="log">
	           	<tr>
	                 <td class="text-center"><if condition="$log.action_user neq 0">管理员：{$admins[$aid]}<else/>用户：{$user[nickname]}</if></td>
	                 <td class="text-center">{$log.log_time|date='Y-m-d H:i:s',###}</td>
	                 <td class="text-center">{$order_status[$log[order_status]]}</td>
	                 <td class="text-center">{$pay_status[$log[pay_status]]}<if condition="$order['pay_code'] eq 'code'"><span style="color: red">(货到付款)</span></if></td>
	                 <td class="text-center">{$shipping_status[$log[shipping_status]]}</td>
	                 <td class="text-center">{$log.status_desc}</td>
	                 <td class="text-center">{$log.action_note}</td>
	             </tr>
              </volist>
          </table>
        </div>
      </div>
      </form>
  	</div>
  </div>
</div>
<script type="text/javascript">


function delfun() {
	// 删除按钮
	layer.confirm('确认删除？', {
		btn: ['确定'] //按钮
	}, function () {
		console.log("确定");
	}, function () {
		console.log("取消");
	});
}

 
</script>
</body>
</html>